import { goodlist } from "./good.js";
var user_id=location.search.split("=")[1]
var tbody=document.getElementsByTagName("tbody")[0];
goodlist.shoppingcar(user_id).then(function(e){
    var html="";
    e.forEach(item => {
        html +=` <tr class="tr1" productId=${item.goods_id}>
                <td class="checkbox"><input class="check-one check" type="checkbox"/></td>
                <td class="goods"><img src="http:${item.goods_pic}" alt=""/><span>${item.goods_name}</span></td>
                <td class="price">${item.goods_price}</td>
                <td class="count"><span class="reduce"></span>
                    <input class="count-input" type="text" value="${item.goods_num}"/>
                    <span class="add">+</span></td>
                <td class="subtotal">${item.goods_price*item.goods_num}</td>
                <td class="operation"><span class="delete">删除</span></td>
            </tr>`
    });
    tbody.innerHTML=html  
})
